//
//  SelectDishViewController.h
//  OrderSeat
//
//  Created by wangwei on 13-10-9.
//  Copyright (c) 2013年 wangwei. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SelectDishLeftCell.h"
#import "SelectDishRightCell.h"
#import "MWPhotoBrowser.h"
#import <AssetsLibrary/AssetsLibrary.h>

@protocol SelectDishCategoriesViewDelegate

-(void)selectDishCatFinished:(NSDictionary*)dic;

@end

@class SelectDishCategoriesView;
@class SelectDishDataSource;
@interface SelectDishViewController : BaseViewController<SelectDishLeftCellDelegate,SelectDishCategoriesViewDelegate,SelectDishRightCellDelegate,MWPhotoBrowserDelegate,UIAlertViewDelegate>

@property (strong, nonatomic) IBOutlet UIButton *btnNext;
@property (strong, nonatomic) IBOutlet UITableView *leftTable;
@property (strong, nonatomic) IBOutlet UITableView *rightTable;
@property (strong, nonatomic) IBOutlet UIView *footerView;
@property (strong, nonatomic) IBOutlet UIButton *titleButton;

@property (strong, nonatomic) SelectDishCategoriesView *selectCategoriesView;

@property (strong, nonatomic) IBOutlet UILabel *totalCountLabel;
@property (strong, nonatomic) IBOutlet UILabel *totalMoneyLabel;

@property (strong, nonatomic) NSString *shopId;
@property (strong, nonatomic) NSString *selectSeats;
@property (strong, nonatomic) NSMutableArray *photoList;
@property (strong, nonatomic) NSMutableArray *selectedDishList;
@property (strong, nonatomic) SelectDishDataSource *dataSource;

- (id)initWithShopId:(NSString*)shopId;

@end

@interface SelectDishDataSource : BaseDataSource<UITableViewDelegate,UITableViewDataSource>

@property (strong, nonatomic) SelectDishViewController *viewController;
@property (strong, nonatomic) NSMutableArray *smallCatList;
@property (strong, nonatomic) NSMutableArray *dishList;
@property (strong, nonatomic) NSMutableDictionary *smallCatCache;
@property (strong, nonatomic) NSMutableDictionary *dishCache;

- (void)fetchDishCategories;
- (void)fetchSmallCatWithCatId:(NSString*)catId;
- (void)fetchDishWithSmallCatId:(NSString*)catId;

@end


@interface SelectDishCategoriesView : UIView<UITableViewDelegate,UITableViewDataSource>

@property (strong, nonatomic) UIImageView *backImage;
@property (strong, nonatomic) NSMutableArray *categoriesList;
@property (strong, nonatomic) UITableView *categoriesTable;
@property (strong, nonatomic) id<SelectDishCategoriesViewDelegate> delegate;

- (void)showOrVisible;

@end
